package com.ad2campaign.engine.core.tasklet;

import java.util.TimerTask;

import org.apache.log4j.Logger;

import com.ad2campaign.engine.core.service.GenericJobService;

public class RecoveryTask  extends TimerTask
{
	protected static final Logger LOGGER =  Logger.getLogger(RecoveryTask.class);
	private String jobName;
	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	private GenericJobService genericJobService;
	
	public GenericJobService getGenericJobService() {
		return genericJobService;
	}

	public void setGenericJobService(GenericJobService genericJobService) {
		this.genericJobService = genericJobService;
	}

	@Override
	public void run() {
 
		LOGGER.info("+-------------------------------One Time Recovery Started--------------------------+");
		genericJobService.resumeJobs(null, jobName);
		LOGGER.info("+-------------------------------One Time Recovery Completed------------------------+");
		
	}

}
